package cn.kgc.controller;

import cn.kgc.commons.vo.Result;
import cn.kgc.dto.add.SmsSpuAddDTO;
import cn.kgc.service.SmsSpuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>添加描述信息</p>
 *
 * @author 卢传琪
 */
@RestController
@RequestMapping("/sms/spu")
@Api(tags = "商品spu")
@Validated
public class SmsSpuController {

    @Resource
    private SmsSpuService smsSpuService;

    @PostMapping("/save")
    @ApiOperation(value = "新增", produces = "application/json;charset=utf-8",
            httpMethod = "POST", response = Result.class)
    @CrossOrigin
    public boolean saveSmsSpu(@RequestBody SmsSpuAddDTO smsSpuAddDTO) {
        return smsSpuService.addSmsSpu(smsSpuAddDTO);
    }
}
